using Application.Dtos;
using MediatR;

namespace Application.Queries;

public class TodoQuery : IRequest<List<TodoResponse>>
{
    public TodoQuery() { }
}

public class GetTodosHandler : IRequestHandler<TodoQuery, List<TodoResponse>>
{
    public GetTodosHandler() { }

    public async Task<List<TodoResponse>> Handle(TodoQuery request, CancellationToken cancellationToken)
    {
        var todos = new List<TodoResponse>();
        todos.Add(new TodoResponse { Name = "eat apple" });
        todos.Add(new TodoResponse { Name = "eat orange" });
        await Task.CompletedTask;
        return todos;
    }
}
